/**
 * 添加设备检定
 */
import React, { useEffect } from 'react'
import Plan  from '../components/plan'
import KeepAlive from 'react-activation'
import { connect } from 'dva'

function Add({dispatch,commonAction: {catchObj}}) {
  useEffect(() => {
    dispatch({
      type: 'commonAction/uploadCatch',
      payload: {
        catchObj: {
          deviceCali_add: [true, false]
        }
      }
    })
  },[dispatch])
  return (
    <KeepAlive name='deviceUpCali_add' when={catchObj.deviceCali_add}>
      <div className="deviceUpCali_add">
        <Plan />
      </div>
    </KeepAlive>
  )
}

export default connect(({commonAction}) => ({
  commonAction
}))(Add)
